home *** CD-ROM | disk | FTP | other *** search
- package engine.levelData
- {
- import copy.CopyBank;
- import engine.WorldScene;
- import engine.dynamicObjects.*;
-
- public class Level_02 extends LevelData
- {
-
-
- public function Level_02()
- {
- super();
- _goalParameters = new Array();
- }
-
- override public function buildLevel() : *
- {
- var i:* = undefined;
- var fuelIcon:* = undefined;
- var goalObj:Object = null;
- var missionObj:Object = null;
- var rNum:* = undefined;
- var podium:* = undefined;
- var cage:* = undefined;
- super.buildLevel();
- for(i = 0; i < 5; i++)
- {
- rNum = Math.random();
- if(rNum < 0.3)
- {
- podium = new Podium("tall");
- podium.x = 2200 + Math.random() * 150 + i * 300;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x;
- cage.y = 568;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- }
- if(rNum >= 0.3 && rNum < 0.6)
- {
- podium = new Podium("med");
- podium.x = 2200 + Math.random() * 150 + i * 300;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x;
- cage.y = 582;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- }
- if(rNum >= 0.6)
- {
- podium = new Podium("short");
- podium.x = 2200 + Math.random() * 150 + i * 300;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x;
- cage.y = 604;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- }
- }
- fuelIcon = new FuelIcon();
- fuelIcon.x = 50;
- fuelIcon.y = 1500;
- WorldScene.Instance.GameplayObjects.push(fuelIcon);
- fuelIcon = new FuelIcon();
- fuelIcon.x = 2500;
- fuelIcon.y = 1500;
- WorldScene.Instance.GameplayObjects.push(fuelIcon);
- _missionDescription = CopyBank.Instance.MissionDesc_Cages;
- goalObj = {
- "Type":"Cage",
- "Count":5
- };
- _goalParameters.push(goalObj);
- missionObj = {
- "Description":_missionDescription,
- "BoundsX":_missionBoundsX,
- "BoundsHint":_missionBoundsHint,
- "GoalParamaters":_goalParameters,
- "PrimaryGoalType":"Cages",
- "StartLoc":{
- "x":5000,
- "y":400
- }
- };
- WorldScene.Instance.setMissionDetails(missionObj);
- }
- }
- }
-